package com.hainatong.shiphelper.mainhome.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.databinding.ItemSubFunViewBinding;
import com.hainatong.shiphelper.mainhome.entity.FunctionEntity;
import org.jetbrains.annotations.NotNull;

public class SubFunctionAdapter extends BaseQuickAdapter<FunctionEntity , BaseDataBindingHolder<ItemSubFunViewBinding>>
{
    public SubFunctionAdapter()
    {
        super(R.layout.item_sub_fun_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemSubFunViewBinding> bindingHolder, FunctionEntity functionEntity)
    {
        ItemSubFunViewBinding binding = bindingHolder.getDataBinding();
        if( binding != null )
        {
            binding.setSubfunction( functionEntity );
            binding.executePendingBindings();
        }
    }
}
